package com.fpt.quanlyhethongsan.controller;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.fpt.quanlyhethongsan.utils.Constants;
import com.fpt.quanlysanbong.dao.SoccerFieldDao;
import com.fpt.quanlysanbong.domain.Account;
import com.fpt.quanlysanbong.domain.SoccerField;

public class MainController {
	
	private List<SoccerField> listSoccerField;
	
	public List<SoccerField> getListSoccerField() {
		return listSoccerField;
	}

	public void setListSoccerField(List<SoccerField> listSoccerField) {
		this.listSoccerField = listSoccerField;
	}

	// return homepage
	public String homepage() {
		HttpSession session = ServletActionContext.getRequest().getSession();
		Account acc = (Account) session.getAttribute(Constants.USER_SESSION);
		listSoccerField = new SoccerFieldDao().getListSoccerFieldForHome(acc);
		return Constants.SUCCESS;
	}

	// return getAbout
	public String getAbout() {
		return Constants.SUCCESS;
	}

	// return getContact
	public String getContact() {
		return Constants.SUCCESS;
	}

}
